#include <iostream>
#include <string>
#include <unistd.h>
#include <signal.h>

void sighandler(int sig)
{
    std::cout<<"收到信号："<<sig<<std::endl;
}

int main()
{
    int i = 0;
    signal(SIGINT,sighandler);
    while (true)
    {
        /* code */
        std::cout<<"hello "<<i<<std::endl;
        i++;
        sleep(1);
    }
    
    return 0;
}